package com.shenmazong.serveredustudent.service.impl;



import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.shenmazong.serveredustudent.mapper.TbStageMapper;
import com.shenmazong.serveredustudent.pojo.TbStage;
import com.shenmazong.serveredustudent.service.TbStageService;
import com.shenmazong.utils.ResultResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 */
@Service
public class TbStageServiceImpl extends ServiceImpl<TbStageMapper, TbStage>
    implements TbStageService {

    @Autowired
    private TbStageMapper stageMapper;

    @Override
    public ResultResponse getStageByMajorId(long majorId) {

        LambdaQueryWrapper<TbStage> eq = new QueryWrapper<TbStage>().lambda().eq(TbStage::getMajorId, majorId);

        List<TbStage> stages = stageMapper.selectList(eq);

        return ResultResponse.SUCCESS(stages);
    }
}




